--- 'https://github.com/Frege/frege/issues/160 Illegal Java code for polymorphic constrained non-function field'
module tests.comp.Issue160 where

{--
    Wrong code for the change function is generated,
    which tries to apply a context to an Object (i.e. the 'Showable.wrong' member) 
-}
-- data Showable = S { flag :: Bool, wrong :: (forall a. Show a => a) } 

--- Even more reduced
data S2 = S2 Bool (forall a.Show a => a)

trythis :: S2 -> String
trythis v  = case v of
    S2 _ x ->  x

main = println "Ok"     -- can not construct an S2
